﻿<div id="mtop_left">
    <ul>
        <li class="icon_menu"><img src="<?=url_tmpl()?>icon/home-icon.png" width="14" height="14" /></li>
        <li class="text_menu"><a title="" href="<?=base_url()?>home<?=url_suffix()?>">Trang chủ</a></li>
        <li class="icon_menu"><img src="<?=url_tmpl()?>icon/About-icon.png" width="14" height="14" /></li>
        <li class="text_menu"><a title="" href="<?=base_url()?>gioi-thieu<?=url_suffix()?>">Giới thiệu</a></li>
        <li class="icon_menu"><img src="<?=url_tmpl()?>icon/Add-icon.png" width="14" height="14" /></li>
        <li class="text_menu"><a title="" href="<?=base_url()?>huong-dan<?=url_suffix()?>">Hướng dẫn</a></li>
    </ul>
</div>
<div id="mtop_right">
    <ul>
    <?php if(empty($datas["email"])):?>
        <li class="icon_menu" style="margin-left:5px;"><a title="" href="<?=base_url()?>dang-tin<?=url_suffix()?>">Đăng tin</a></li>
        <li style="width:30px;"><img style="margin-top:2px;" src="<?=url_tmpl()?>icon/add-2-icon.png" width="12" height="12" /></li>
        <li style="margin-left:5px;"><a title="" href="<?=base_url()?>thanh-vien/dangnhap<?=url_suffix()?>">Đăng nhập</a></li>
        <li style="width:30px;"><img src="<?=url_tmpl()?>icon/login.png" width="16" height="16" /></li>
        <li style="margin-left:5px;"><a title="" href="<?=base_url()?>thanh-vien/dangky<?=url_suffix()?>">Đăng ký</a></li>
        <li style="width:30px;"><img src="<?=url_tmpl()?>icon/key-icon.png" width="14" height="14" /></li>
    <?php else:?>
        <li  style="width:80px; margin-top:2px; margin-left:10px; ">
            <div style="float:left; margin-right:6px;"><img src="<?=url_tmpl()?>icon/setting.png" width="13" height="13" /></div>
            <div style="float:left;margin-top:-2px;"><a href="#" class="signin"><span>Chức năng</span></a></div>
            <fieldset class="dialog caidat" id="signin_menu">
                 <div class="topdangtin">
                    <div class="topdangtin_t">&nbsp;</div>
                    <div class="topdangtin_c">
                        <div class="topdangtin_item">
                            <div class="topdangtin_item_icon"></div>
                            <div class="topdangtin_item_content"><a class="text" href="<?=base_url()?>thanh-vien<?=url_suffix()?>">Thông tin cá nhân</a></div>
                        </div>
                        <div class="topdangtin_item">
                            <div class="topdangtin_item_icon"></div>
                            <div class="topdangtin_item_content"><a class="text" href="<?=base_url()?>thanh-vien/doimatkhau<?=url_suffix()?>">Thay đổi mật khẩu</a></div>
                        </div>
                        <div class="topdangtin_item">
                            <div class="topdangtin_item_icon"></div>
                            <div class="topdangtin_item_content"><a class="text" href="<?=base_url()?>thanh-vien/quyenmatkhau<?=url_suffix()?>">Quyên mật khẩu</a></div>
                        </div>
                        <div class="topdangtin_item">
                            <div class="topdangtin_item_icon"></div>
                            <div class="topdangtin_item_content"><a onclick="javascript:return confirm('Bạn chắc chắn thoát khỏi hệ thống?')" class="text" href="<?=base_url()?>thanh-vien/dangxuat<?=url_suffix()?>">Thoát</a></div>
                        </div>
                        <div id="both"></div>
                    </div>
                    <div class="topdangtin_u"></div>
                 </div>
            </fieldset>  
        </li>
        <li style="width:65px; margin-top:1px; margin-left:15px;">
             <div style="float:left; margin-right:6px; margin-top:2px;"><img src="<?=url_tmpl()?>icon/add-2-icon.png" width="12" height="12" /></div>
             <div style="float:left;margin-top:-1px;"><a href="#" class="dangtin"><span>Đăng tin</span></a></div>
             <fieldset class="dialog" id="listdangtin">
                 <div class="topdangtin">
                    <div class="topdangtin_t">&nbsp;</div>
                    <div class="topdangtin_c">
                        <div class="topdangtin_item">
                            <div class="topdangtin_item_icon"></div>
                            <div class="topdangtin_item_content"><a class="text" href="<?=base_url()?>dang-tin/raovat<?=url_suffix()?>">Mua bán rao vặt</a></div>
                        </div>
                        <div class="topdangtin_item">
                            <div class="topdangtin_item_icon"></div>
                            <div class="topdangtin_item_content"><a class="text" href="<?=base_url()?>dang-tin/daugia<?=url_suffix()?>">Đấu giá</a></div>
                        </div>
                        <div class="topdangtin_item">
                            <div class="topdangtin_item_icon"></div>
                            <div class="topdangtin_item_content"><a class="text" href="<?=base_url()?>dang-tin/bat-dong-san<?=url_suffix()?>">Bất động sản</a></div>
                        </div>
                        <div id="both"></div>
                    </div>
                    <div class="topdangtin_u"></div>
                 </div>
              </fieldset>
        </li>
        
        <li style="width:90px; margin-top:1px; margin-left:15px;">
             <div style="float:left; margin-right:6px; margin-top:-1px;"><img src="<?=url_tmpl()?>icon/dadang.png" width="15" height="15" /></div>
             <div style="float:left;margin-top:-1px;"><a href="#" class="tindadang"><span>Tin đã đăng</span></a></div>
             <fieldset class="dialog" id="listtindadang">
                 <div class="topdangtin">
                    <div class="topdangtin_t">&nbsp;</div>
                    <div class="topdangtin_c">
                        <div class="topdangtin_item">
                            <div class="topdangtin_item_icon"></div>
                            <div class="topdangtin_item_content"><a class="text" href="#">Mua bán rao vặt</a></div>
                        </div>
                        <div class="topdangtin_item">
                            <div class="topdangtin_item_icon"></div>
                            <div class="topdangtin_item_content"><a class="text" href="#">Đấu giá</a></div>
                        </div>
                        <div class="topdangtin_item">
                            <div class="topdangtin_item_icon"></div>
                            <div class="topdangtin_item_content"><a class="text" href="<?=base_url()?>dang-tin-bds<?=url_suffix()?>">Bất động sản</a></div>
                        </div>
                        <div id="both"></div>
                    </div>
                    <div class="topdangtin_u"></div>
                 </div>
              </fieldset>
        </li>
        <!--<li style="width:22px; margin-top:1px; margin-left:15px;">
             <div style="float:left; margin-right:6px;"><a href="#" class="comment"><img src="<?=url_tmpl()?>icon/comment.png" width="14" height="14" style="border:none;"/></a></div>
             <div style="float:left;margin-top:-1px;"></div>
             <!--<fieldset class="dialog"  id="listcomment" >
                 <div class="topdangtin">
                    <div class="topdangtin_t">&nbsp;</div>
                    <div class="topdangtin_c_comment">
                        <img src="<?=url_tmpl()?>icon/icon_loading.gif" />
                    </div>
                    <div class="topdangtin_u"></div>
                 </div>
              </fieldset>
        </li>-->
        
        <li class="icon_menu" style="margin-left:5px;"><a title="" href="#"><?=$datas['ten']?></a></li>
        <li style="width:30px;"><img style="margin-top:-1px;" src="<?=base_url()?>files/thanhvien/thumb/<?=($imgs)?>" width="20" height="20" /></li>
    <?php endif?>
    </ul>
</div>
                   
<script type="text/javascript">
        $(document).ready(function() {
			//Thanh vien
            $(".signin").click(function(e) {          
				e.preventDefault();
                $("fieldset#signin_menu").toggle();
            });
			$("fieldset#signin_menu").mouseup(function() {
				return false
			});
			//Dang tin
			$(".dangtin").click(function(e) {          
				e.preventDefault();
                $("fieldset#listdangtin").toggle();
            });
			$("fieldset#listdangtin").mouseup(function() {
				return false
			});
			//Da dang 
			$(".tindadang").click(function(e) {          
				e.preventDefault();
                $("fieldset#listtindadang").toggle();
            });
			$("fieldset#listtindadang").mouseup(function() {
				return false
			});
			//comment
			$(".comment").click(function(e) {          
				e.preventDefault();
                $("fieldset#listcomment").toggle();
            });
			$("fieldset#listcomment").mouseup(function() {
				return false
			});
			$(document).mouseup(function(e) {
				if($(e.target).parent("a.signin").length==0) {
					$("fieldset#signin_menu").hide();
				}
				if($(e.target).parent("a.dangtin").length==0) {
					$("fieldset#listdangtin").hide();
				}
				if($(e.target).parent("a.tindadang").length==0) {
					$("fieldset#listtindadang").hide();
				}
				if($(e.target).parent("a.comment").length==0) {
					$("fieldset#listcomment").hide();
				}
			});			
			
        });
</script>